/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.hanhpt.btvn1;

import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Bai2M2 
{
    public static void main(String[] args) 
    {
        Scanner sc=new Scanner(System.in);
        System.out.println("nhap so phan tu cua mang ");
       int n;
             n=sc.nextInt();
      int [] a=new int[n];
       int [] b=new int[n];
        System.out.println("nhap cac phan tu cua mang ");
        for(int i=0;i<n;i++)
        { 
            a[i]=sc.nextInt();
            b[i]=1;
        }
        for(int i=0;i<n;i++)
            if(b[i]!=0)
                for(int j=i+1;j<n;j++)
                if(a[i]==a[j])
                {
                   b[i]++;
                   b[j]=0;
                }
           for(int i=0;i<n;i++)
               if(b[i]!=0)
               System.out.println("phan tu"+a[i]+"xuat hien"+b[i]+"lan");
    }
}
